/**
 *
 */
package com.bsoft.gol.hbs.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.spring.boot.annotation.SsdevDao;
import ctd.util.annotation.RpcService;
import hc.message.entity.MsgTplGroup;
import java.util.List;

/**
 * @since 2018-03-01 09:37:53
 */
@SsdevDao(serviceId = "tplGroupService")
public abstract class TplGroupDAO extends ctd.persistence.support.hibernate.HibernateSupportDelegateDAO<MsgTplGroup> {

    public TplGroupDAO() {
        this.setKeyField("groupId");
    }

    @RpcService
    @DAOMethod(sql = "from MsgTplGroup where groupId=:groupId")
    public abstract MsgTplGroup getTplGroupById(@DAOParam("groupId") Integer groupId);

    @RpcService
    @DAOMethod(sql = "from MsgTplGroup")
    public abstract List<MsgTplGroup> findTplGroups();

    @RpcService
    @DAOMethod(sql = "update MsgTplGroup set groupStatus = :status where groupId = :groupId")
    public abstract void updateTplGroupStatus(@DAOParam("groupId") Integer groupId, @DAOParam("status") byte status);

    @RpcService
    public void saveMsgTplGroup(MsgTplGroup msgTplGroup) {
        this.save(msgTplGroup);
    }

    @RpcService
    public void updateMsgTplGroup(MsgTplGroup msgTplGroup) {
        this.update(msgTplGroup);
    }

    @RpcService
    public void deleteMsgTplGroup(Integer msgTplGroupId) {
        this.remove(msgTplGroupId);
    }
}